//
//  SearchView.m
//  AudioBook_A
//
//  Created by 蒙奇-D-小路 on 15/4/18.
//  Copyright (c) 2015年 Sansan. All rights reserved.
//

#define LABELWIDTH (ScreenFram.width-120)/3

#import "SearchView.h"

@implementation SearchView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self creatView];
    }
    return self;
}



- (void)creatView
{
    
    self.backgroundColor = [UIColor whiteColor];
    UIView *colorView = [[UIView alloc] initWithFrame:CGRectMake(0, 79, 5, 20)];
    colorView.backgroundColor = [UIColor redColor];
    UILabel *hotLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 74, 80, 30)];
    hotLabel.text = @"热门搜索";
    [self addSubview:colorView];
    [self addSubview:hotLabel];
    [colorView release];
    [hotLabel release];
    
    self.hotUIbutton1 = [UIButton buttonWithType:UIButtonTypeCustom];
    self.hotUIbutton1.frame = CGRectMake(40, 124, LABELWIDTH, 30);
    self.hotUIbutton1.backgroundColor = [UIColor lightGrayColor];
    
    self.hotUIbutton2 = [UIButton buttonWithType:UIButtonTypeCustom];
    self.hotUIbutton2.frame = CGRectMake(60+LABELWIDTH, 124, LABELWIDTH, 30);
    self.hotUIbutton2.backgroundColor = [UIColor lightGrayColor];
    
    self.hotUIbutton3 = [UIButton buttonWithType:UIButtonTypeCustom];
    self.hotUIbutton3.frame = CGRectMake(80+2*LABELWIDTH, 124, LABELWIDTH, 30);
    self.hotUIbutton3.backgroundColor = [UIColor lightGrayColor];
    
    self.hotUIbutton4 = [UIButton buttonWithType:UIButtonTypeCustom];
    self.hotUIbutton4.frame = CGRectMake(40, 164, LABELWIDTH, 30);
    self.hotUIbutton4.backgroundColor = [UIColor lightGrayColor];
    
    self.hotUIbutton5 = [UIButton buttonWithType:UIButtonTypeCustom];
    self.hotUIbutton5.frame = CGRectMake(60+LABELWIDTH, 164, LABELWIDTH, 30);
    self.hotUIbutton5.backgroundColor = [UIColor lightGrayColor];
    
    self.hotUIbutton6 = [UIButton buttonWithType:UIButtonTypeCustom];
    self.hotUIbutton6.frame = CGRectMake(80+2*LABELWIDTH, 164, LABELWIDTH, 30);
    self.hotUIbutton6.backgroundColor = [UIColor lightGrayColor];
    self.hotUIbutton7 = [UIButton buttonWithType:UIButtonTypeCustom];
    self.hotUIbutton7.frame = CGRectMake(40, 204, LABELWIDTH, 30);
    self.hotUIbutton7.backgroundColor = [UIColor lightGrayColor];
    self.hotUIbutton8 = [UIButton buttonWithType:UIButtonTypeCustom];
    self.hotUIbutton8.frame = CGRectMake(60+LABELWIDTH, 204, LABELWIDTH, 30);
    self.hotUIbutton8.backgroundColor = [UIColor lightGrayColor];
    self.hotUIbutton9 = [UIButton buttonWithType:UIButtonTypeCustom];
    self.hotUIbutton9.frame = CGRectMake(80+2*LABELWIDTH, 204, LABELWIDTH, 30);
    self.hotUIbutton9.backgroundColor = [UIColor lightGrayColor];
    
    [self addSubview:self.hotUIbutton9];
    [self addSubview:self.hotUIbutton8];
    [self addSubview:self.hotUIbutton7];
    [self addSubview:self.hotUIbutton6];
    [self addSubview:self.hotUIbutton5];
    [self addSubview:self.hotUIbutton4];
    [self addSubview:self.hotUIbutton3];
    [self addSubview:self.hotUIbutton2];
    [self addSubview:self.hotUIbutton1];
    
    [_hotUIbutton9 release];
    [_hotUIbutton8 release];
    [_hotUIbutton7 release];
    [_hotUIbutton6 release];
    [_hotUIbutton5 release];
    [_hotUIbutton4 release];
    [_hotUIbutton3 release];
    [_hotUIbutton2 release];
    [_hotUIbutton1 release];
    
}




/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
